package com.firexxx.vp.domain.mlv;

import com.firexxx.common.errors.BaseErrors;
import com.firexxx.vp.adapter.engine.MlvPlppnccEngineFacade;
import com.firexxx.vp.adapter.engine.MlvPnccEngineFacade;
import com.firexxx.vp.domain.vp.VoicePrintResourceType;
import com.firexxx.vp.utils.BeanUtil;

/**
 * @description: TODO
 * @throws:
 * @author: zhuangzhang2
 * @date: 2019/12/23 19:33
 */
public class MlvEngineFactory {

    public static MlvEngineInterface getInstance(VoicePrintResourceType vpResourceType) {
        if (vpResourceType == VoicePrintResourceType.PNCC) {
            return BeanUtil.getBean(MlvPnccEngineFacade.class);
        } else if (vpResourceType == VoicePrintResourceType.PLPPNCC) {
            return BeanUtil.getBean(MlvPlppnccEngineFacade.class);
        }

        throw BaseErrors.MLV_ERROR.getThrow(
                "不支持的mlv引擎资源类型"
        );
    }

}